<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Reference</title>
    <link rel="stylesheet" href="../../luadoc.css" type="text/css" />
	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>

<body>
<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->

<div id="main">

<div id="navigation">


<h1>LuaDoc</h1>
<ul>
	
	<li><a href="../../index.html">Index</a></li>
	
</ul>


<!-- Module list -->



<!-- File list -->

<h1>Files</h1>
<ul>

	<li>
		<a href="../../files/Compiler.html">Compiler.lua</a>
	</li>

	<li>
		<a href="../../files/Editor.html">Editor.lua</a>
	</li>

	<li>
		<a href="../../files/Instance.html">Instance.lua</a>
	</li>

	<li>
		<a href="../../files/Libraries.html">Libraries.lua</a>
	</li>

	<li>
		<a href="../../files/Permissions.html">Permissions.lua</a>
	</li>

	<li>
		<a href="../../files/Preprocessor.html">Preprocessor.lua</a>
	</li>

	<li>
		<a href="../../files/SFLib.html">SFLib.lua</a>
	</li>

	<li>
		<a href="../../files/libs_cl/ents.html">libs_cl/ents.lua</a>
	</li>

	<li>
		<a href="../../files/libs_cl/screen.html">libs_cl/screen.lua</a>
	</li>

	<li>
		<a href="../../files/libs_sh/builtins.html">libs_sh/builtins.lua</a>
	</li>

	<li>
		<a href="../../files/libs_sh/files.html">libs_sh/files.lua</a>
	</li>

	<li>
		<a href="../../files/libs_sh/find.html">libs_sh/find.lua</a>
	</li>

	<li>
		<a href="../../files/libs_sh/time.html">libs_sh/time.lua</a>
	</li>

	<li>
		<a href="../../files/libs_sh/trace.html">libs_sh/trace.lua</a>
	</li>

	<li><strong>libs_sv/ents.lua</strong></li>
	
	<li>
		<a href="../../files/libs_sv/wire.html">libs_sv/wire.lua</a>
	</li>

	<li>
		<a href="../../files/reload.html">reload.lua</a>
	</li>

</ul>






</div> <!-- id="navigation" -->

<div id="content">

<h1>File <code>libs_sv/ents.lua</code></h1>







<h2>Functions</h2>
<table class="function_list">

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.CanModify">SF.Entities.CanModify</a>&nbsp;(ply, ent)</td>
	<td class="summary">Checks to see if a player can modify an entity without the override permission </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.GetOwner">SF.Entities.GetOwner</a>&nbsp;(entity)</td>
	<td class="summary">Gets the entity's owner TODO: Optimize this! </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.GetPhysObject">SF.Entities.GetPhysObject</a>&nbsp;(entity)</td>
	<td class="summary">Gets the physics object of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.IsValid">SF.Entities.IsValid</a>&nbsp;(entity)</td>
	<td class="summary">Returns true if valid, false if not </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.Unwrap">SF.Entities.Unwrap</a>&nbsp;(wrapped)</td>
	<td class="summary">Unwraps an entity wrapper to a real entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.Wrap">SF.Entities.Wrap</a>&nbsp;(ent)</td>
	<td class="summary">Wraps a real entity to an entity wrapper </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_lib.owner">ents_lib.owner</a>&nbsp;()</td>
	<td class="summary">Returns whoever created the script </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_lib.player">ents_lib.player</a>&nbsp;()</td>
	<td class="summary">Same as ents_lib.owner() on the server.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_lib.self">ents_lib.self</a>&nbsp;()</td>
	<td class="summary">Returns the entity representing a processor that this script is running on.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:ang">ents_metatable:ang</a>&nbsp;()</td>
	<td class="summary">Returns the angle of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:applyAngForce">ents_metatable:applyAngForce</a>&nbsp;(ang)</td>
	<td class="summary">Applies angular force to the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:applyForce">ents_metatable:applyForce</a>&nbsp;(vec, offset)</td>
	<td class="summary">Applies linear force to the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:applyTorque">ents_metatable:applyTorque</a>&nbsp;(tq)</td>
	<td class="summary">Applies torque </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:class">ents_metatable:class</a>&nbsp;()</td>
	<td class="summary">Returns the class of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:index">ents_metatable:index</a>&nbsp;()</td>
	<td class="summary">Returns the EntIndex of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:isValid">ents_metatable:isValid</a>&nbsp;()</td>
	<td class="summary">Checks if an entity is valid.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:mass">ents_metatable:mass</a>&nbsp;()</td>
	<td class="summary">Returns the mass of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:owner">ents_metatable:owner</a>&nbsp;()</td>
	<td class="summary">Gets the owner of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:pos">ents_metatable:pos</a>&nbsp;()</td>
	<td class="summary">Returns the position of the entity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:setAng">ents_metatable:setAng</a>&nbsp;(ang)</td>
	<td class="summary">Sets the entity's angles </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:setPos">ents_metatable:setPos</a>&nbsp;(vec)</td>
	<td class="summary">Sets the entitiy's position </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:setVel">ents_metatable:setVel</a>&nbsp;(vel)</td>
	<td class="summary">Sets the entity's linear velocity </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:toLocal">ents_metatable:toLocal</a>&nbsp;(data)</td>
	<td class="summary">Converts a vector in world space to entity local space </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:toWorld">ents_metatable:toWorld</a>&nbsp;(data)</td>
	<td class="summary">Converts a vector in entity local space to world space </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#ents_metatable:vel">ents_metatable:vel</a>&nbsp;()</td>
	<td class="summary">Returns the velocity of the entity </td>
	</tr>

</table>




<h2>Tables</h2>
<table class="table_list">

	<tr>
	<td class="name" nowrap><a href="#SF.Entities.Metatable">SF.Entities.Metatable</a></td>
	<td class="summary">The entity wrapper metatable </td>
	</tr>

</table>



<br/>
<br/>




<h2><a name="functions"></a>Functions</h2>
<dl class="function">



<dt><a name="SF.Entities.CanModify"></a><strong>SF.Entities.CanModify</strong>&nbsp;(ply, ent)</dt>
<dd>
Checks to see if a player can modify an entity without the override permission


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>ply</em></code>: The player
	</li>
	
	<li>
	  <code><em>ent</em></code>: The entity being modified
	</li>
	
</ul>








</dd>




<dt><a name="SF.Entities.GetOwner"></a><strong>SF.Entities.GetOwner</strong>&nbsp;(entity)</dt>
<dd>
Gets the entity's owner TODO: Optimize this!


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>entity</em></code>: 
	</li>
	
</ul>






<h3>Return value:</h3>
<ul>The entities owner, or nil if not found</ul>



</dd>




<dt><a name="SF.Entities.GetPhysObject"></a><strong>SF.Entities.GetPhysObject</strong>&nbsp;(entity)</dt>
<dd>
Gets the physics object of the entity


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>entity</em></code>: 
	</li>
	
</ul>






<h3>Return value:</h3>
<ul>The physobj, or nil if the entity isn't valid or isn't vphysics</ul>



</dd>




<dt><a name="SF.Entities.IsValid"></a><strong>SF.Entities.IsValid</strong>&nbsp;(entity)</dt>
<dd>
Returns true if valid, false if not


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>entity</em></code>: 
	</li>
	
</ul>








</dd>




<dt><a name="SF.Entities.Unwrap"></a><strong>SF.Entities.Unwrap</strong>&nbsp;(wrapped)</dt>
<dd>
Unwraps an entity wrapper to a real entity


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>wrapped</em></code>: 
	</li>
	
</ul>








</dd>




<dt><a name="SF.Entities.Wrap"></a><strong>SF.Entities.Wrap</strong>&nbsp;(ent)</dt>
<dd>
Wraps a real entity to an entity wrapper


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>ent</em></code>: 
	</li>
	
</ul>








</dd>




<dt><a name="ents_lib.owner"></a><strong>ents_lib.owner</strong>&nbsp;()</dt>
<dd>
Returns whoever created the script









</dd>




<dt><a name="ents_lib.player"></a><strong>ents_lib.player</strong>&nbsp;()</dt>
<dd>
Same as ents_lib.owner() on the server.









</dd>




<dt><a name="ents_lib.self"></a><strong>ents_lib.self</strong>&nbsp;()</dt>
<dd>
Returns the entity representing a processor that this script is running on. May be nil









</dd>




<dt><a name="ents_metatable:ang"></a><strong>ents_metatable:ang</strong>&nbsp;()</dt>
<dd>
Returns the angle of the entity







<h3>Return value:</h3>
<ul>The angle</ul>



</dd>




<dt><a name="ents_metatable:applyAngForce"></a><strong>ents_metatable:applyAngForce</strong>&nbsp;(ang)</dt>
<dd>
Applies angular force to the entity


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>ang</em></code>: The force angle
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:applyForce"></a><strong>ents_metatable:applyForce</strong>&nbsp;(vec, offset)</dt>
<dd>
Applies linear force to the entity


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>vec</em></code>: The force vector
	</li>
	
	<li>
	  <code><em>offset</em></code>: An optional offset position (TODO: Local or world?)
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:applyTorque"></a><strong>ents_metatable:applyTorque</strong>&nbsp;(tq)</dt>
<dd>
Applies torque


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>tq</em></code>: The torque vector
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:class"></a><strong>ents_metatable:class</strong>&nbsp;()</dt>
<dd>
Returns the class of the entity







<h3>Return value:</h3>
<ul>The string class name</ul>



</dd>




<dt><a name="ents_metatable:index"></a><strong>ents_metatable:index</strong>&nbsp;()</dt>
<dd>
Returns the EntIndex of the entity







<h3>Return value:</h3>
<ul>The numerical index of the entity</ul>



</dd>




<dt><a name="ents_metatable:isValid"></a><strong>ents_metatable:isValid</strong>&nbsp;()</dt>
<dd>
Checks if an entity is valid.







<h3>Return value:</h3>
<ul>True if valid, false if not</ul>



</dd>




<dt><a name="ents_metatable:mass"></a><strong>ents_metatable:mass</strong>&nbsp;()</dt>
<dd>
Returns the mass of the entity







<h3>Return value:</h3>
<ul>The numerical mass</ul>



</dd>




<dt><a name="ents_metatable:owner"></a><strong>ents_metatable:owner</strong>&nbsp;()</dt>
<dd>
Gets the owner of the entity









</dd>




<dt><a name="ents_metatable:pos"></a><strong>ents_metatable:pos</strong>&nbsp;()</dt>
<dd>
Returns the position of the entity







<h3>Return value:</h3>
<ul>The position vector</ul>



</dd>




<dt><a name="ents_metatable:setAng"></a><strong>ents_metatable:setAng</strong>&nbsp;(ang)</dt>
<dd>
Sets the entity's angles


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>ang</em></code>: New angles
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:setPos"></a><strong>ents_metatable:setPos</strong>&nbsp;(vec)</dt>
<dd>
Sets the entitiy's position


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>vec</em></code>: New position
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:setVel"></a><strong>ents_metatable:setVel</strong>&nbsp;(vel)</dt>
<dd>
Sets the entity's linear velocity


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>vel</em></code>: New velocity
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:toLocal"></a><strong>ents_metatable:toLocal</strong>&nbsp;(data)</dt>
<dd>
Converts a vector in world space to entity local space


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>data</em></code>: Local space vector
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:toWorld"></a><strong>ents_metatable:toWorld</strong>&nbsp;(data)</dt>
<dd>
Converts a vector in entity local space to world space


<h3>Parameters:</h3>
<ul>
	
	<li>
	  <code><em>data</em></code>: Local space vector
	</li>
	
</ul>








</dd>




<dt><a name="ents_metatable:vel"></a><strong>ents_metatable:vel</strong>&nbsp;()</dt>
<dd>
Returns the velocity of the entity







<h3>Return value:</h3>
<ul>The velocity vector</ul>



</dd>


</dl>




<h2><a name="tables"></a>Tables</h2>
<dl class="table">

<dt><a name="SF.Entities.Metatable"></a><strong>SF.Entities.Metatable</strong></dt>
<dd>The entity wrapper metatable<br /><br />



</dd>


</dl>




</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->	
</body>
</html>
